package cn.wen.util;

import java.awt.Color;
import java.awt.Graphics;
import java.util.Random;

/**
* @ClassName: PointDisruptor
* @Description: 干扰点
* @author Gavin Nie  
* @e-mail Nie_ZW@163.com
* @date 2014年7月6日 上午10:33:17
*/ 
public class PointDisruptor implements Disruptor
{

	@Override
	public Graphics getDisruptor(Graphics grap, int size)
	{
		Random random = new Random();
		for (int i = 0; i < size; i++)
		{
			int x = random.nextInt(IdentifyCodeUtil.WIDTH);
			int y = random.nextInt(IdentifyCodeUtil.HEIGHT);
			grap.setColor(new Color(random.nextInt(255),random.nextInt(255),random.nextInt(255)));
			grap.drawLine(x, y, x+1, y+1);
		}
		return grap;
	}

}
